/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package czStvDpds.network;

import czStvDpds.logging.Logging;
import java.net.DatagramPacket;
import java.util.logging.Level;
import java.util.logging.Logger;
import czStvDpds.network.*;
/**
 *
 * @author Xide
 */
public class PotvrzeniThread extends Thread {

    private Sender s;
    public boolean potvrzeni = false;
    private DatagramPacket q;

    

    public PotvrzeniThread(Sender s) {
        this.s = s;
    }
    
    public void setPacket(DatagramPacket q) {
            this.q = q;
    }

    
    
    public void run() {
        while (potvrzeni == false) {  
            
            
            s.sendPacket(q);
            try {
                PotvrzeniThread.sleep(10000);
            } catch (InterruptedException ex) {
                Logger.getLogger(PotvrzeniThread.class.getName()).log(Level.SEVERE, null, ex);
            }



        }       

    }
    
    
    
    
    public void ukonciVlakno() {
        potvrzeni = true;
        Logging.getMainLogger().log(Level.SEVERE, "Pripojeni potvrzeno, PotvrzeniThread ukoncen");
    }
}
